﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PracticeEveryday
{
    public class _250513
    {

        static void Main1(string[] args)
        {
            while (true)
            {
                Console.WriteLine("请输入要转换的数字：");
                string? input = Console.ReadLine();
                double inputConvert = Convert.ToDouble(input);
                CalSetTempCode(inputConvert);
            }
        }
        public static void CalSetTempCode(double SetTemp)
        {
            var datas = new List<byte>();
            var Rt = 100 * (1 + 0.0039083 * SetTemp - 0.0000005775 * SetTemp * SetTemp);
            var VTemp = 2500 * Rt / (4990 + Rt) - 2500.0 / 5090 * 100;
            var Vcode = (int)(VTemp * 16777215 / 4096);
            datas = BitConverter.GetBytes(Vcode).ToList();
            datas.RemoveAt(3);
            var result = BitConverter.ToString(datas.ToArray()).Replace("-","");
            Console.WriteLine($"转换结果：{result}");
            //return datas.ToArray();
        }
    }
}
